﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="role_popedom.aspx.cs" Inherits="admin_manager_role_popedom" %>

<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>Lomboz JSP</title>
<link href="../css/default.css" rel="stylesheet" type="text/css" />

<script language="javascript"> 
var o;
function subfunc() {		
	o = document.forms[0];
	if(o.rolename.value==""){
		return warning('rolename','角色名称不能为空!');
	}			
	return true;	
}
function warning(FieldName,WarningString){
		alert(WarningString);
		//eval("o." + FieldName + ".focus();");
		return(false);
}

function pselectall(sid)
{
	var name = "";
	for(x=0;x<document.forms[0].elements.length;x++){
		name = document.forms[0].elements[x].name;
		if(name.indexOf("id"+sid)!=-1) {
			document.forms[0].elements[x].checked=eval("document.forms[0].aid"+sid+".checked");
		}
	}
} 
function zselectall(id,sid)
{
  for(x=0;x<document.forms[0].elements.length;x++){
     if(document.forms[0].elements[x].name==("id2"+sid+"mm"+id)) {
		document.forms[0].elements[x].checked=eval("document.forms[0].id1"+sid+"mm"+id+".checked");
     }
  }
}
function sselectall()
{
   for(x=0;x<document.forms[0].elements.length;x++){
     if(document.forms[0].elements[x].name.indexOf("id2")!=-1) {
		document.forms[0].elements[x].checked=document.forms[0].id0.checked;
     }
  } 
}
</script>

</head>

<body>
<table width="100%" height="600" border="0" align="left" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

  <tr> 
    <td height="414" align="left" valign="top"><table width="100%" height="489" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="26"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="2" bgcolor="#A49B81"></td>
          </tr>
          <tr>
            <td height="22" background="../images/position_bg.gif" bgcolor="#EEF6FE" class="subnav" style="background-repeat:repeat-y; background-position:left; padding-left:6px; padding-top:3px;">
            
            <asp:Label ID="reader" runat="server" /><img src='../images/subnav_dot.gif' width='9' height='9' />&nbsp;&nbsp;权限设置  
            
            </td>
          </tr>
          <tr>
            <td height="1" bgcolor="#B0C9E8"></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="30"></td>
      </tr>
      <tr>
        <td height="410" align="left" valign="top" style="padding-left:10px;">
<table width="90%" height="183" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#2583BC" bordercolordark="#ffffff">
 <form name="form1" method="post" runat="server" >
          <tr>
            <td width="100%" height="181" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <th align="left">角色信息</th>
                </tr>
            </table>
              <table width="100%" height="117" border="0">
                <tr>
                  <td  height="20" colspan="2"></td>
                </tr>
                
                <tr>
                  <td width="15%" height="33" align="right"><b>角色名称：</b></td>
                  <td width="85%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="red"><asp:Label ID="rolenametext" runat="server" /></font>
                  <asp:HiddenField ID="rid" runat="server" />
                  <asp:HiddenField ID="rolename" runat="server" />
                  <input type="hidden" name="layerid" value="<%=layerid%>"/>
                  </td>
                </tr>   
                
                 <tr>
                    <td align="right" > <b>栏目管理权限：</b> </td>
                    <td>
                    <table width="100%" border=0  cellpadding="0" cellspacing="0">
					          <tr class="">
					            <td align="left"  height="25" width="40%">
					            <table border=0>
									<tr>
										<td width="40"></td>
										<td width="120"><input type="checkbox" name="aid001"  onclick="pselectall('001')" <%=isPopedom("001","show,add,del,mod")%>/>栏目管理</td>
									</tr>					            
					            </table>
					            </td>
					            <td class="gary_bg bor" align="left">
					            
					            <input name='id001' type='checkbox' value='show' <%=isPopedom("001","show")%> />浏览
								<input name='id001' type='checkbox' value='add' <%=isPopedom("001","add")%>/>增加
								<input name='id001' type='checkbox' value='del' <%=isPopedom("001","del")%>/>删除
								<input name='id001' type='checkbox' value='mod' <%=isPopedom("001","mod")%>/>修改
					            </td>					            
					          </tr>
                    </table>
                    </td>
                  </tr>         
                  
                 <tr>
                    <td colspan=2>
							<table width="90%" bgcolor="#A49B81" border="1" align="center">
									<tr>
										<td></td>
									</tr>					            
					            </table>                    
                    </td>
                  </tr>                                                          
                                                        
                  <tr>
                    <td align="right" > <b>内容管理权限：</b> </td>
                    <td>
                    <table width="100%" border=0  cellpadding="0" cellspacing="0">
					
					          <%
                                  int id = 0;   //id
                                  int sid = 0;  //父id
                                  string layer = "";  //菜单序号
                                  string popedom = ""; //权限字符串
                                  OgilvyOne.Model.UserColumnModel sm = null;
                                  string linkurl = "";
                                  int tablewidth = 0;              
					
					          %>
					         <% for(int i=0;i<columnlist.Count;i++){
						sm = (OgilvyOne.Model.UserColumnModel)columnlist[i];
						layer = sm.Layerid;
						tablewidth = (layer.Split(',').Length-1) * 20;
						id = sm.Columnid;
						%>
					          <tr class="">
					            <td align="left"  height="25" width="40%">
					            <table border=0>
									<tr>
										<td width="<%=tablewidth%>"></td>
										<td width="<%=tablewidth+100%>">
										<%
							            if(sm.Columntypeid!=1){%>
							            <input type="checkbox" name="aid<%=id%>" onclick="pselectall('<%=id%>')" <%=isPopedom(layer,"show,add,del,mod"+(sm.isAduit()?",audit,pub":""))%>/>
							            <%=sm.Columnname%>
                                        <%}else{%>
							            <font color=blue><%=sm.Columnname%></font>
							            <%} %>
										</td>
									</tr>					            
					            </table>
					            </td>
					            <td class="gary_bg bor" align="left">
					            <%
					            if(sm.Columntypeid!=1){
					            %>
					            	
					            	<input name='id<%=id%>' type='checkbox' value='show' <%=isPopedom(layer,"show")%> />浏览
					            	<input name='id<%=id%>' type='checkbox' value='add' <%=isPopedom(layer,"add")%> />增加
					            	<input name='id<%=id%>' type='checkbox' value='del' <%=isPopedom(layer,"del")%> />删除
					            	<input name='id<%=id%>' type='checkbox' value='mod' <%=isPopedom(layer,"mod")%> />修改
					            	<%if(sm.isAduit() ){%>
					            	<input name='id<%=id%>' type='checkbox' value='audit' <%=isPopedom(layer,"audit")%> />审核
					            	<input name='id<%=id%>' type='checkbox' value='pub' <%=isPopedom(layer,"pub")%> />发布
					            <%}}%>
					            </td>
					          </tr>		
					          <%
					        }
					        %>
					          		
					
                    </table>                      
                    </td>
                  </tr>
                  
                 <tr>
                    <td colspan=2>
							<table width="90%" bgcolor="#A49B81" border="1" align="center">
									<tr>
										<td></td>
									</tr>					            
					            </table>                    
                    </td>
                  </tr>                   
                  
                 <tr>
                    <td align="right" > <b>系统管理权限：</b> </td>
                    <td>
                    <table width="100%" border=0  cellpadding="0" cellspacing="0">
                    
                        <% for (int i = 0; i < syscolumnlist.Count; i++)
                           {
                               sm = (OgilvyOne.Model.UserColumnModel)syscolumnlist[i];
						layer = sm.Layerid;
						tablewidth = (layer.Split(',').Length-1) * 20;
                        tablewidth += 20;
						id = sm.Columnid;
						%>
					          <tr class="">
					            <td align="left"  height="25" width="40%">
					            <table border=0>
									<tr>
										<td width="<%=tablewidth%>"></td>
										<td width="<%=tablewidth+100%>">
										<%
							            if(sm.Columnurl!="0"){%>
							            <input type="checkbox" name="aid<%=id%>" onclick="pselectall('<%=id%>')" <%=isPopedom(layer,"show,add,del,mod")%>/>
							            <%=sm.Columnname%>
                                        <%}else{%>
							            <font color=blue><%=sm.Columnname%></font>
							            <%} %>
										</td>
									</tr>					            
					            </table>
					            </td>
					            <td class="gary_bg bor" align="left">
					            <%
                                    if (sm.Columnurl != "0")
                                    {
					            %>
					            	
					            	<input name='id<%=id%>' type='checkbox' value='show' <%=isPopedom(layer,"show")%> />浏览
					            	<input name='id<%=id%>' type='checkbox' value='add' <%=isPopedom(layer,"add")%> />增加
					            	<input name='id<%=id%>' type='checkbox' value='del' <%=isPopedom(layer,"del")%> />删除
					            	<input name='id<%=id%>' type='checkbox' value='mod' <%=isPopedom(layer,"mod")%> />修改
					            <%}%>
					            </td>
					          </tr>		
					          <%
					        }
					        %>
					          				          					          					          				          
                    </table>
                    </td>
                  </tr>  

                <tr>
                  <td height="50" align="right"></td>
                  <td height="35" align="left">
                  <asp:Button Text="提交" ID="submit" runat="server" OnClick="btn_Click" OnClientClick="return subfunc();"/>
                     <input type="reset" name="resetname" value="重填" />
                     <input type="button" name="Submit" onclick="javascript:location.href='<%=setbBckUrl("role_list.aspx")%>';" value="返回" />
                  </td>
                </tr>
              </table> 
              </td>
          </tr>
          </form>
        </table>        
        </td>
          </tr>
        </table>          </td>
      </tr>
    </table><td></td>
  </tr>
</table>
<asp:Label ID="message" runat="server" />
</body>
</html>
